package com.lv.fast.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lv.fast.DTO.SysLogDTO;
import com.lv.fast.DTO.SysLogPageQuery;
import com.lv.fast.dao.SysLogDao;
import com.lv.fast.service.SysLogService;
import com.lv.fast.util.PageUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author jie.lv
 */
@Service
@AllArgsConstructor
public class SysLogServiceImpl implements SysLogService {

    private final SysLogDao sysLogDao;

    @Override
    public IPage<SysLogDTO> list(SysLogPageQuery pageQuery){
        pageQuery.setSortBy("created_time");
        Page page = PageUtil.getPage(pageQuery);
        IPage<SysLogDTO> logDTOIPage = sysLogDao.list(page, pageQuery);
        return logDTOIPage;
    }
}
